package com.lz.demo6;

/**
 * @ClassName Dog
 * @Description 狗类
 * @Author 2214361854
 * @Date 2022/5/28 14:48
 * @Version 1.0
 */
public class Dog {
    private String name;//姓名
    private int age;//年龄
    private String kind;//品种
    private String host;//主人
    private double price;//价格

    //4.1提供本类的无参构造
    public Dog(){
        System.out.println("我是Dog类的无参构造");
    }
    //4.2提供本类的含参构造
    public Dog(int n){
        System.out.println("我是Dog类的含参构造"+n);
    }
    //4.3提供本类的全参构造
    public Dog(String name, int age, String kind, String host, double price) {
        this.name = name;
        this.age = age;
        this.kind = kind;
        this.host = host;
        this.price = price;
        System.out.println("我是Dog类的全参构造");
    }

    //5.1提供Dog自己的跑的功能
    public void run(){
        System.out.println("小狗狗跑的老快了~");
    }
    //5.2提供Dog自己的吃的功能
    public void eat(){
        System.out.println("小狗爱吃肉骨头");
    }
    //5.3提供Dog自己的睡觉的功能
    public void sleep(){
        System.out.println("小狗一天睡几个小时来着？");
    }
    //5.4提供Dog自己的玩的功能
    public void play(){
        System.out.println("小狗爱玩飞盘~");
    }

    @Override
    public String toString() {
        return "Dog{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", kind='" + kind + '\'' +
                ", host='" + host + '\'' +
                ", price=" + price +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getKind() {
        return kind;
    }

    public void setKind(String kind) {
        this.kind = kind;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
}
